package com.jh.paymentchannel.repository;

import com.google.common.collect.Range;
import com.jh.paymentchannel.pojo.PaymentOrder;
import com.jh.paymentchannel.pojo.UserTurnover;
import org.jetbrains.annotations.Nullable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * @author Fuchun
 * @since 1.0
 */
public interface PaymentOrderRepositoryCustom {

    List<Long> findUserIdsOnTradeSuccess(Range<Date> dateRange);

    Map<Long, UserTurnover> findUserTurnovers(
            Range<Date> dateRange, @Nullable Specification<PaymentOrder> otherSpec);

    Page<PaymentOrder> findTradingSuccess(
            Range<Date> dateRange, @Nullable Specification<PaymentOrder> otherSpec,
            Pageable pageable);
}
